package o;

import android.os.Build.VERSION;

public abstract class wu {
    public static final wu ʻ = ˏ;
    public static final sb<wu> ʼ = sb.ˎ("com.bumptech.glide.load.resource.bitmap.Downsampler.DownsampleStrategy", ʻ);
    public static final wu ˊ = new a();
    public static final wu ˋ = new e();
    public static final wu ˎ = new b();
    public static final wu ˏ = new d();
    public static final wu ॱ = new c();
    public static final wu ॱॱ = new g();
    static final boolean ᐝ = (VERSION.SDK_INT >= 19);

    static class a extends wu {
        a() {
        }

        public float ˎ(int i, int i2, int i3, int i4) {
            return Math.min(1.0f, ˋ.ˎ(i, i2, i3, i4));
        }

        public h ˏ(int i, int i2, int i3, int i4) {
            if (ˎ(i, i2, i3, i4) == 1.0f) {
                return h.QUALITY;
            }
            return ˋ.ˏ(i, i2, i3, i4);
        }
    }

    static class b extends wu {
        b() {
        }

        public float ˎ(int i, int i2, int i3, int i4) {
            int i5 = 1;
            int ceil = (int) Math.ceil((double) Math.max(((float) i2) / ((float) i4), ((float) i) / ((float) i3)));
            int max = Math.max(1, Integer.highestOneBit(ceil));
            if (max >= ceil) {
                i5 = 0;
            }
            return 1.0f / ((float) (max << i5));
        }

        public h ˏ(int i, int i2, int i3, int i4) {
            return h.MEMORY;
        }
    }

    static class c extends wu {
        c() {
        }

        public float ˎ(int i, int i2, int i3, int i4) {
            int min = Math.min(i2 / i4, i / i3);
            if (min == 0) {
                return 1.0f;
            }
            return 1.0f / ((float) Integer.highestOneBit(min));
        }

        public h ˏ(int i, int i2, int i3, int i4) {
            return h.QUALITY;
        }
    }

    static class d extends wu {
        d() {
        }

        public float ˎ(int i, int i2, int i3, int i4) {
            return Math.max(((float) i3) / ((float) i), ((float) i4) / ((float) i2));
        }

        public h ˏ(int i, int i2, int i3, int i4) {
            return h.QUALITY;
        }
    }

    static class e extends wu {
        e() {
        }

        public float ˎ(int i, int i2, int i3, int i4) {
            if (ᐝ) {
                return Math.min(((float) i3) / ((float) i), ((float) i4) / ((float) i2));
            }
            int max = Math.max(i2 / i4, i / i3);
            if (max != 0) {
                return 1.0f / ((float) Integer.highestOneBit(max));
            }
            return 1.0f;
        }

        public h ˏ(int i, int i2, int i3, int i4) {
            if (ᐝ) {
                return h.QUALITY;
            }
            return h.MEMORY;
        }
    }

    static class g extends wu {
        g() {
        }

        public float ˎ(int i, int i2, int i3, int i4) {
            return 1.0f;
        }

        public h ˏ(int i, int i2, int i3, int i4) {
            return h.QUALITY;
        }
    }

    public enum h {
        MEMORY,
        QUALITY
    }

    public abstract float ˎ(int i, int i2, int i3, int i4);

    public abstract h ˏ(int i, int i2, int i3, int i4);
}
